package com.qyhl.webtv.module_circle.circle.circleshield;

import android.widget.ImageView;

import com.qyhl.webtv.commonlib.entity.circle.CircleHomeBean;

import java.util.List;

/**
 * Created by qyhl on 2018/3/7.
 */

public class CircleShieldPresenter implements CircleShieldContract.CircleShieldPresenter {
    private CircleShieldModel mModel;

    private CircleShieldActivity mView;

    public CircleShieldPresenter(CircleShieldActivity mView) {
        this.mView = mView;
        this.mModel = new CircleShieldModel(this);
    }

    @Override
    public void getShieldList() {
        mModel.getShieldList();
    }

    @Override
    public void getListSuccess(List<CircleHomeBean.User> beanList) {
        mView.getListSuccess(beanList);
    }

    @Override
    public void getListError(int code, String msg) {
        switch (code) {
            case 0:
                mView.setNetError(msg);
                break;
            case 1:
                mView.setError(msg);
                break;
            default:
                break;

        }
    }

    @Override
    public void doBlock(String username, ImageView imageView) {
        mModel.doBlock(username, imageView);
    }

    @Override
    public void undoBlock(String username, ImageView imageView) {
        mModel.undoBlock(username, imageView);
    }

    @Override
    public void blockSuccess(String msg, ImageView imageView) {
        mView.blockSuccess(msg, imageView);
    }

    @Override
    public void blockError(String msg) {
        mView.blockError(msg);
    }

    @Override
    public void unBlockSuccess(String msg, ImageView imageView) {
        mView.unBlockSuccess(msg, imageView);
    }

    @Override
    public void unBlockError(String msg) {
        mView.unBlockError(msg);
    }
}
